#  Copyright 2007 GRAHAM DUMPLETON
# 
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

APXS = @APXS@

DESTDIR =
LIBEXECDIR = @LIBEXECDIR@
VERSION = @VERSION@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LDLIBS = @LDLIBS@

all : @SOMODULENAME@.la

@SOMODULENAME@.la : mod_icpquery.c
	$(APXS) -c $(CPPFLAGS) $(CFLAGS) $< $(LDFLAGS) $(LDLIBS) -o $@

$(DESTDIR)$(LIBEXECDIR) :
	mkdir -p $@

install : all $(DESTDIR)$(LIBEXECDIR)
	$(APXS) -i -S LIBEXECDIR=$(DESTDIR)$(LIBEXECDIR) -n '@SOMODULENAME@' @SOMODULENAME@.la 

clean :
	-rm -rf .libs
	-rm -f @SOMODULENAME@.la 
	-rm -f mod_icpquery.o mod_icpquery.lo mod_icpquery.slo mod_icpquery.loT
	-rm -f config.log config.status
	-rm -rf autom4te.cache

distclean : clean
	-rm -f defaults.h

realclean : distclean
	-rm -f Makefile configure mod_icpquery.spec

tar: distclean
	cd ..; \
	tar czf mod_icpquery-$(VERSION).tar.gz --exclude .svn mod_icpquery 

